#ifndef _POWCALCULATE_H_
#define _POWCALCULATE_H_



//----Power adjustment---
#define C_PowerChangeDebTH 		6 	
#define C_PowerBigChange 		200

//-----Target Power Compare Tolerance---
#define C_LO_TOR 				10
#define C_LOWPOW_END_TIME 		13 // lowPow_out_time = ovp interrupt to AC Voltage zero

//-----IGBT High temperature limiting target power---
#define C_IGBT_HIGHTEMP_LIMITPOWER		1600	//IGBT High temperature limiting power 1600W





extern vu8 	Statu_LowPow_Work, ovp_cnt, ovp_end_cnt;
extern vu8	LowPow_Cycle,LowPow_Cnt,LowPow_ON;
extern vu16 LowPow_EndTime_Cnt;

extern vu8 LowPow_Cycle;
extern vu16 R_PowerIV,TargetPower;
extern vu16 LimTargetPower;

void LowPow_Init(void);
void LowPow_Control(void);
void LowPow_PowerUpdata();


void PowerControl(void);
void PowerControl_Task(void);

u16 Power_Cutdown(void); ////limit the power


#endif